package com.chexiehui.jc.mvp.car;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarSeriesInfo;
import com.chexiehui.jc.entity.ShopInfo;
import com.chexiehui.jc.entity.TelInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 车型详情
 * @Auth SongJun
 * @Date 2020/05/21 00:18
 **/
public interface CarModelDetailsCovenant {

    interface View extends BaseView {
       /* void onGetSeriesInfoSuccess(BaseModel<CarSeriesInfo> successResult);
        void onGetSeriesInfoFailure(BaseModel<Object> failureResult);*/
        void onAddInstallmentSuccess(BaseModel<Object> successResult);
        void onAddInstallmentFailure(BaseModel<Object> failureResult);
        void onAddShopInquirySuccess(BaseModel<Object> successResult);
        void onAddShopInquiryFailure(BaseModel<Object> failureResult);
        void onGetSalespersonTelSuccess(BaseModel<TelInfo> successResult);
        void onGetSalespersonTelFailure(BaseModel<Object> failureResult);
        void onGetShopListSuccess(BaseModel<BasePage<ShopInfo>> successResult);
        void onGetShopListFailure(BaseModel<Object> failureResult);

        String getSeriesId();

        String getLocationLat();

        String getLocationLng();

        String getLocationCity();

        String getCarId();

        String getDescType();
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_CAR_SERIES_DETAIL)
        Observable<BaseModel<CarSeriesInfo>> getSeriesInfo(@Field("Id") String Id);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_ADD_INSTALLMENT)
        Observable<BaseModel<Object>> addInstallment(
                @Field("carid") String carid,
                @Field("shopids") String shopids,
                @Field("phone") String phone,
                @Field("name") String name,
                @Field("city") String city);
        @FormUrlEncoded
        @POST(Constants.URL_CAR_ADD_SHOP_INQUIRY)
        Observable<BaseModel<Object>> addShopInquiry(
                @Field("type") String type,
                @Field("carid") String carid,
                @Field("shopids") String shopids,
                @Field("phone") String phone,
                @Field("name") String name,
                @Field("city") String city);

        @FormUrlEncoded
        @POST(Constants.URL_GET_SALER_TEL)
        Observable<BaseModel<TelInfo>> getSalespersonTel(
                @Field("Id") String Id
        );

        @FormUrlEncoded
        @POST(Constants.URL_HOME_SHOP_LIST)
        Observable<BaseModel<BasePage<ShopInfo>>> getShopList(
                @Field("carId") String carId,
                @Field("lat") String lat,
                @Field("lng") String lng,
                @Field("descType") String descType,
                @Field("cityName") String cityName,
                @Field("pageIndex") int pageIndex,
                @Field("pageSize") int pageSize
        );
    }

    interface Presenter {
//        void getSeriesInfo();
        void addInstallment(String carid, String shopids, String phone, String name, String city);
        void addShopInquiry(String carid, String shopids, String phone, String name, String city);
        void getSalespersonTel();
        void getShopList(int pageNum);
    }

}